package com.yckj.day03;

/**
 * TODO 案例1 使用while循环对1+2+3+...+100进行求和
 *
 * @author shengyuee
 * @version 1.0
 * 2025/7/18 10:19
 */
public class WhileDemo1 {
    public static void main(String[] args) {
        int n = 1;
        int sum = 0;
        while(n <= 100){
            sum = sum + n;
            n++;
        }
        System.out.println("sum = " + sum);
    }
}
